

// recursive function for functionception!
function loadFolder(path,app) {
	require("fs").readdirSync('./'+path).forEach(function(file) {
	  if (file != "BaseCtrl.js" && file != "index.js") {
	  	var fl = file.length;
	  	if(file.substring(fl-3,fl) == ".js" ) {
	  		require("./" + file).run(app);
	  	} else {
	  		new_path = path+'/'+file
	  		loadFolder(new_path,app);
	  	}

	  	
	  }
	});
}



module.exports = function (app) {
	loadFolder('controllers',app);

}


